Improve Bluetooth handling: permission errors and automatic reconnection#52
Open
GlassOnTin wants to merge 4 commits intocdump:masterfrom
Open
Improve Bluetooth handling: permission errors and automatic reconnection#52GlassOnTin wants to merge 4 commits intocdump:masterfrom
GlassOnTin wants to merge 4 commits intocdump:masterfrom
Conversation
- Detect when user is not in bluetooth group - Provide clear instructions for permanent fix (usermod command) - Show exact sudo command as temporary workaround - Enhanced error messages for common Bluetooth failures - Check permissions before attempting Bluetooth scan - Improve user experience when running without proper permissions This makes it much clearer to users why Bluetooth scanning fails and provides actionable steps to resolve the issue.
- Implement connection state tracking (disconnected/connecting/connected/reconnecting) - Add exponential backoff for reconnection attempts (1s to 60s max) - Enhance error handling to detect Bluetooth disconnections - Add comprehensive logging for connection state changes - Ensure device continues attempting reconnection until manually stopped This improves reliability when Bluetooth connections drop due to: - Device timeouts after prolonged streaming - Bluetooth interference - Device power cycling - Other processes connecting to the device
Owner
|
Please rebase your branch to the current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Features
1. Enhanced Permission Error Handling
2. Automatic Reconnection Logic
ConnectionStateenum to track connection states (disconnected/connecting/connected/reconnecting)Benefits
This improves reliability when:
Changes
device_reader.py: Added permission checks and automatic reconnection logicradiacode/discovery.py: Enhanced BTLEException handling to identify permission-related failuresExample Output
Permission Error:
Reconnection:
Test plan